import requests from './index.js'

export const getProductList = () => requests({ url: '/product', method: 'get' })

// 登入
export const login = (username, password) => requests({ url: '/login', method: 'post', data: { username, password } })

// 退出登入
export const logout = () => requests({ url: '/logout', method: 'post' })

// 获取某个产品的信息
export const productAttr = (id) => requests({ url: `/product/${id}`, method: 'get' })

// 获取购买产品时的信息
export const dettaitList = (id) => requests({ url: `/dettail/${id}`, method: 'get' })

// 获取购物车的数据
export const shopCat = () => requests({ url: '/shopcat', method: 'get' })

// 获取添加到购物车中的商品数据
export const addShopCat = (id) => requests({ url: '/addshopcat', method: 'post', data: { id } })

// 获取用户地址
export const userAddress = () => requests({ url: '/address', method: 'get' })

// 获取用户订单数据
export const orderList = () => requests({ url: '/orderlist', method: 'get' })

// 获取abs图片数据
export const absList = () => requests({ url: '/abslist', method: 'get' })

// 获取首页attrs商品数据
export const attrsList = () => requests({ url: '/attrsList', method: 'get' })
